package com.huaxin.hxcloud.find;

import android.content.Context;
import android.text.Html;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.huaxin.common.Entity.FindInfo;
import com.huaxin.hxcloud.R;

/**
 * @author songxf
 * @date 2017/10/26
 * @Desc 评论adapter
 * Copyright HUAXIN DATA. All rights reserved.
 */
public class HxCommentAdapter extends BaseQuickAdapter<FindInfo.QuestionListBean.PartialTopCommentArrBean, BaseViewHolder> {
    private Context mContext;

    public HxCommentAdapter(Context context) {
        super(R.layout.item_comment_style);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, FindInfo.QuestionListBean.PartialTopCommentArrBean item) {
        TextView mCommentTv = helper.getView(R.id.comment_tv);
        String str = "<font color='#38adff'>" + item.getPublisher().getNickName() + "：" + "</font>" + item.getContent();
        mCommentTv.setText(Html.fromHtml(str));
    }
}
